namespace Pyxis.FluentSelenium.Locator
{
    public class ImageLocator : ILocator
    {
        private readonly string locator;

        private ImageLocator(string locator)
        {
            this.locator = locator;
        }

        public void Append(ILocator parentLocator)
        {
        }

        public static ImageLocator WithId(string id)
        {
            return new ImageLocator(XPathHelper.BuildLocatorForId(id));
        }

        public static ImageLocator Contains(string fragment)
        {
            return new ImageLocator(XPathHelper.BuildLocatorForWithContaining(fragment));
        }

        public static ImageLocator WithXpath(string xpathLocator)
        {
            return new ImageLocator(xpathLocator);
        }

        public override string ToString()
        {
            return locator;
        }
    }
}